<template>
  <div class="item-input">
    <el-input
      v-bind="$attrs"
      v-model="Val"
      @blur="blur ? blur() : none()"
      @focus="focus ? focus() : none()"
      @change="change ? change() : none()"
    ></el-input>
  </div>
</template>

<script>
export default {
  name: "Input",
  data() {
    return {
      Val: "",
    };
  },
  props: {
    value: [String, Number],
    blur: {
      type: Function,
      default: () => () => {},
    },
    focus: {
      type: Function,
      default: () => () => {},
    },
    change: {
      type: Function,
      default: () => () => {},
    },
  },
  watch: {
    Val: function (newVal) {
      this.$emit("update:value", newVal);
    },
  },
  created() {
    this.Val = this.value;
  },
  methods: {
    none() {
      return false;
    },
  },
};
</script>


<style scoped lang="less">
</style>
